package org.snail.employee.service.manager;

import lombok.extern.log4j.Log4j;
import org.snail.dept.bean.DepartDO;
import org.snail.employee.service.push.EmployeesPushService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 管理人员队列消息
 */
@Component
@Log4j
public class EmployeesManager {

    @Autowired
    private EmployeesPushService employeesPushService;


    public void synchronizeEmployeeByDepartment(DepartDO departDO) {
        if (null == departDO || departDO.getId() < 1){
            log.error("获取部门ID有误，同步部门下人员信息");
        } else {
            employeesPushService.push(departDO);
        }
    }
}
